var login = new Validated();
login.rules = {
    "englishname": {
        "data": /^\S{1,}$/,
        "complete": "ok",
        "error": "不可以包含空格",
        "required": "true"
    },
    "yong": {
        "data": /^[0-9]{1,}$/,
        "complete": "ok",
        "error": "只能输入数字",
        "required": "true"
    }, "legal": {
        "data": /^\S{1,}$/,
        "complete": "ok",
        "error": "名字不可以包含空格",
        "required": "true"
    }, "enterpriseurl": {
        "data": /^\S{1,}$/,
        "complete": "ok",
        "error": "输入网址有误",
        "required": "true"
    }, "fulladress": {
        "data": /^\S{1,}$/,
        "complete": "ok",
        "error": "不可以包含空格",
        "required": "true"
    }, "enterprisejs": {
        "data": /^\s{1,}|\S{1,}$/,
        "complete": "ok",
        "error": "不可以为空",
        "required": "true"
    }
};
login.blur().focus();
$('button').click(function () {
    if (login.complete("englishname", "yong", "legal", "enterpriseurl", "fulladress", "enterprisejs")) {
        new Ajax("/my/infor_net.jsp").keyvalue($('#form').serializeArray()).getJson(function (json) {
            if (json === 1) {
                $(window.parent.document).find('body').css({
                    "overflow-x": "hidden",
                    "overflow-y": "hidden"
                });
                $(window.parent.document).find("#vague").show();
            };
        });
        $('button').html("修改");
    }
});
var pattern = $('#pattern').val();
switch (pattern) {
    case "1":
        $("#pattern1").attr("checked", "checked");
        break;
    case "2":
        $("#pattern2").attr("checked", "checked");
        break;
    case "3":
        $("#pattern3").attr("checked", "checked");
        break;
    case "4":
        $("#pattern4").attr("checked", "checked");
        break;
}


